﻿@model CacheViewModel
@{ 
	ViewBag.Title = "View cache";
	ViewData["CacheActive"] = true;
}

@Html.SiteSettingsNavigation()
@if (TempData["CacheCleared"] != null)
{
	<div class="alert alert-success alert-temporary">
		@SiteStrings.SiteSettings_Cache_Clear_Successful
	</div>
}

@if (!Model.IsCacheEnabled)
{
	<div class="alert alert-warning">
		<p>@SiteStrings.SiteSettings_Cache_Not_Enabled</p>
	</div>
}

<form role="form" method="post" action="@Url.Action("Clear", "Cache")">
	<input name="clear" type="submit" class="btn btn-primary" value="@SiteStrings.SiteSettings_Cache_Clear_Button" />
</form>

<div>
	<!-- Page view model cache -->
	<h2>@SiteStrings.SiteSettings_Cache_Page_Cache (@Model.PageKeys.Count())</h2>
	<p>
		@SiteStrings.SiteSettings_Cache_Key_Format "page ID.version"
	</p>
	<table class="table table-striped">
		<thead>
			<tr>
				<th>@SiteStrings.SiteSettings_Cache_Key_Column_Header</th>
			</tr>
		</thead>
		@foreach (string cacheKey in Model.PageKeys)
		{
		<tr>
			<td class="title">@cacheKey</td>
		</tr>
		}
	</table>
	<br class="clear" />

	<!-- List cache -->
	<h2>@SiteStrings.SiteSettings_Cache_List_Cache (@Model.ListKeys.Count())</h2>
	<table class="table table-striped">
		<thead>
			<tr>
				<th>@SiteStrings.SiteSettings_Cache_Key_Column_Header</th>
			</tr>
		</thead>
	@foreach (string cacheKey in Model.ListKeys)
	{
		<tr>
			<td class="title">@cacheKey</td>
		</tr>
	}
	</table>

	<!-- Site wide cache -->
	<h2>@SiteStrings.SiteSettings_Cache_Site_Cache (@Model.SiteKeys.Count())</h2>
	<table class="table table-striped">
		<thead>
			<tr>
				<th>@SiteStrings.SiteSettings_Cache_Key_Column_Header</th>
			</tr>
		</thead>
		@foreach (string cacheKey in Model.SiteKeys)
		{
			<tr>
				<td class="title">@cacheKey</td>
			</tr>
		}
	</table>
	<br class="clear" />
</div>